#ifndef VIDEOWIDGET_H
#define VIDEOWIDGET_H

#include <QWidget>
#include <QPainter>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVideoWidget>
#include <QFileDialog>
#include <QDebug>

namespace Ui {
class VideoWidget;
}

class VideoWidget : public QWidget
{
    Q_OBJECT

public:
    explicit VideoWidget(QWidget *parent = 0);
    ~VideoWidget();
protected:
    void paintEvent(QPaintEvent *event);
    QString formatTime(qint64 time);
    void updateInfo();
private slots:

    void updatePos(qint64);

    void updateDurTime(qint64);

    void on_fileButton_clicked();

    void on_backButton_clicked();

    void on_startButton_clicked();

    void on_progressSlider_valueChanged(int value);

    void on_preButton_clicked();

    void on_nextButton_clicked();


    void on_volumnButton_clicked();

    void on_volumnSlider_valueChanged(int value);

private:
    Ui::VideoWidget *ui;

    QMediaPlayer *m_player;
    QMediaPlaylist *m_playList;
    QVideoWidget *m_videoWidget;
    bool m_playflag;
};

#endif // VIDEOWIDGET_H
